package org.xxpay.pay.channel.maicheng;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;
import org.xxpay.common.unify.AbstractPaymentConfig;
import org.xxpay.pay.channel.sand.response.SandResBody;
@Component
@Data
@ToString
@NoArgsConstructor
public class MaichengConfig extends AbstractPaymentConfig {
    public static final String CHANNEL_NAME = "maicheng";
    public static final String CHANMEL_NAME_QUICK = CHANNEL_NAME + "_quick";

    public static final String RETURN_VALUE_SUCCESS = "1";//上游订单状态成功标识
    public static final String RESPONSE_RESULT_FAIL = "fail";
    public static final String RESPONSE_RESULT_OK = "SUCCESS"; // 返回上游成功
    public static final String RESPONSE_RESULT_SUCCESS = "SUCCESS"; // 返回上游成功

    public static final String REQ_PAY_URL_FIXX = "/channel/apiPay";
    public static final String REQ_PAY_QUERY_URL_FIXX = "";
    public static final String REQ_TRANS_URL_FIXX = "/channel/apiWithdraw";
    public static final String REQ_TRANS_QUERY_URL_FIXX = "/channel/apiQueryWithdraw";


    MaichengConfig(String payParam){
        Assert.notNull(payParam, "init quanmin config error");
        JSONObject object = JSON.parseObject(payParam);
        setAppId(object.getString("appId"));
        setPrivateKey(object.getString("privateKey"));
        setRequestUrl(object.getString("requestUrl"));
    }
}
